<?php

namespace App\Http\Controllers;

use App\Models\Archive;
use Illuminate\Http\Request;

class IndexController extends Controller
{
    public function index()
    {
        $archives = Archive::with(['files', 'tagged', 'likes', 'user', 'category'])->whereHas('files')->withCount('likes')->latest()->paginate();
        return view('archives.index', compact('archives'));
    }
}
